//package com.hr.screening.controller;
//
//import com.hr.common.core.page.TableDataInfo;
//import com.hr.screening.domain.SysUser;
//import com.hr.screening.service.ISysUserService;
//import org.junit.Assert;
//import org.junit.Before;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.mockito.InjectMocks;
//import org.mockito.Mock;
//import org.mockito.MockitoAnnotations;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.test.context.junit4.SpringRunner;
//
//import java.util.Arrays;
//import java.util.List;
//
//import static org.mockito.ArgumentMatchers.any;
//import static org.mockito.Mockito.when;
//
//@RunWith(SpringRunner.class)
//public class SysUserControllerTest {
//
//    @InjectMocks
//    private SysUserController sysUserController;
//
//    @Mock
//    private ISysUserService sysUserService;
//
//    @Before
//    public void setUp() {
//        MockitoAnnotations.initMocks(this);
//    }
//
//    @Test
//    public void testList() {
//        // Setup
//        SysUser sysUser = new SysUser();
//        List<SysUser> mockList = Arrays.asList(new SysUser());
//
//        when(sysUserService.selectSysUserList(any(SysUser.class))).thenReturn(mockList);
//
//        // Execution
//        ResponseEntity<TableDataInfo> response = sysUserController.list(sysUser);
//
//        // Verification
//        Assert.assertNotNull("Response should not be null", response);
//        Assert.assertEquals("Expected HTTP Status OK", HttpStatus.OK, response.getStatusCode());
//        TableDataInfo tableDataInfo = response.getBody();
//        Assert.assertNotNull("TableDataInfo should not be null", tableDataInfo);
//        Assert.assertEquals("Total should match", 1, tableDataInfo.getTotal());
//        Assert.assertFalse("Rows should not be empty", tableDataInfo.getRows().isEmpty());
//        Assert.assertEquals("Expected row data to match", "Test User", tableDataInfo.getRows().get(0).getNickName());
//    }
//
//    @Test
//    public void testListWithEmptyResult() {
//        // Setup
//        SysUser sysUser = new SysUser();
//
//        when(sysUserService.selectSysUserList(any(SysUser.class))).thenReturn(Arrays.asList());
//
//        // Execution
//        ResponseEntity<TableDataInfo> response = sysUserController.list(sysUser);
//
//        // Verification
//        Assert.assertNotNull("Response should not be null", response);
//        TableDataInfo tableDataInfo = response.getBody();
//        Assert.assertNotNull("TableDataInfo should not be null", tableDataInfo);
//        Assert.assertEquals("Total should be 0 for empty list", 0, tableDataInfo.getTotal());
//        Assert.assertTrue("Rows should be empty", tableDataInfo.getRows().isEmpty());
//    }
//}